<template>
   <div class="spike-marketing views-container">
        <div class="wlm-table">
             <div class="wlm-table-header">
            <el-form :model="tableFormatData.lookform.files" size="small" label-width="80px" class="retail-form" label-position="right">
                <el-form-item class="filter">
                    <el-form-item label="支付状态：">
                      <el-select v-model="tableFormatData.lookform.files.pay_status" placeholder="请选择">
                          <el-option
                            v-for="item in [{ value: '20',label: '已支付'},
                                            { value: '10',label: '未支付'}]"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                        </el-select>
                    </el-form-item>
                </el-form-item>
                <el-form-item label="" class="filter-btns">
                    <el-button v-waves type="primary" @click="filesSerch">筛选</el-button>
                    <el-button type="text" @click="filesEmpty">清空筛选条件</el-button>
                </el-form-item>
            </el-form>
        </div>
            <div class="wlm-table-header">
               <div>
                    表单名称：{{this.$route.query.form_title}}
                   <span style="margin-left:200px;">
                   表单类型：<span v-if="this.$route.query.type==2">商品表单</span>
                            <!-- <span v-if="this.$route.query.type==1">弹窗表单</span> -->
                            <span v-if="this.$route.query.type==3">抽奖表单</span>
                            <span v-if="this.$route.query.type==4">分销商表单</span>
                   </span>
               </div>
            </div>
            <div class="wlm-table-content">
            <el-table :ref="tableFormatData.lookform.key" :data="tableFormatData.lookform.tableData" @selection-change="handleSelectionChange" style="width: 100%">
                <el-table-column prop="date" label="编号"  min-width="40">
                    <template slot-scope="scope">
                        <span>{{scope.row.id}}</span>
                    </template>
                </el-table-column>
                 <el-table-column prop="date" label="用户"  min-width="40">
                    <template slot-scope="scope">
                       <div class="flex-row">
                            <img width="50" height="50" :src="scope.row.avatarUrl" style="margin-right:10px;" />
                            <div >
                                <p>{{scope.row.nickName || '-'}}</p>
                            </div>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="添加时间"  min-width="40">
                    <template slot-scope="scope">
                        <span>{{scope.row.create_time}}</span>
                    </template>
                </el-table-column>
                   <el-table-column prop="date" label="支付状态"  min-width="40">
                    <template slot-scope="scope">
                        <span v-if="scope.row.pay_status==20">已支付</span>
                        <span v-else>未支付</span>
                    </template>
                </el-table-column>
               <el-table-column prop="date" label="操作"  min-width="40">
                    <template slot-scope="scope">
                         <router-link class="wlm-text" tag="span" :to="{path:'/application/detailscustormPosterform',query:{id:scope.row.id}}">
                         <el-button type="text">查看详情</el-button>
                         </router-link>
                    </template>
                </el-table-column>
            </el-table>
            <div class="pagination-content flex-row flex-justify-e flex-align-c">
                <el-pagination :disabled="!hasTableData" @size-change="listPageChange" @current-change="listPageChange" :current-page.sync="tableFormatData.lookform.pagination.page" :page-sizes="tableFormatData.lookform.pagination.pagesizes" :page-size.sync="tableFormatData.lookform.pagination.list_rows" layout="total, sizes, prev, pager, next, jumper" :total="hasTableData?tableFormatData.lookform.pagination.total : 0">
                </el-pagination>
            </div>
        </div>
        </div>
  </div>

</template>
<script>
import {
  formSubmitLists
} from '@/api/merchant'
import waves from '@/directive/waves'
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Table')],
  name: 'Lookform',
  components: {
  },
  directives: {
    waves
  },
  data() {
    return {
      tableFormatData: {
        current: 'lookform',
        lookform: {
          key: 'lookform',
          api: {
            getList: formSubmitLists
          },
          tableData: [],
          files: {
            form_id: this.$route.query.form_id,
            time: [],
            ids: [],
            checkall: '0',
            Recycle: '1'
          },
          pagination: {
            page: 1,
            list_rows: 50,
            pagesizes: [50, 100],
            total: 0
          }
        }
      }
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
